#include "initialsettings.h"

initialsettings::initialsettings(QWidget *parent,
	QString aliasp, QString path_rsap, QString path_agnp)
	: QDialog(parent)
{
	setupUi(this);
	alias = aliasp;
	edit_alias->setText(alias);
	path_rsa = path_rsap;
	edit_path_rsa->setText(path_rsa);
	path_agn = path_agnp;
	edit_path_agn->setText(path_agn);
}

void initialsettings::on_edit_alias_textChanged(QString text)
{ alias = text; }

void initialsettings::on_edit_path_rsa_textChanged(QString text)
{ path_rsa = text; }

void initialsettings::on_edit_path_agn_textChanged(QString text)
{ path_agn = text; }

void initialsettings::on_rsasearch_clicked()
{
	QString fileName;
	fileName = QFileDialog::getOpenFileName(this,
       tr("Open key"), "", tr("RSA private key (*.key)"));
	edit_path_rsa->setText(fileName);
	path_rsa = fileName;
}

void initialsettings::on_agnsearch_clicked()
{
	QString fileName;
	fileName = QFileDialog::getOpenFileName(this,
                tr("Open agenda"), "", tr("RSA agenda (*.agn)"));
	edit_path_agn->setText(fileName);
	path_agn = fileName;
}

initialsettings::~initialsettings()
{

}

